#pragma once
#include <wxtl\handle.h>

namespace wxtl
{
	class CompletionPort : public wxtl::Handle
	{
	public:
		CompletionPort(size_t threads = 0);
		~CompletionPort(void);

		void Associate(HANDLE file, ULONG_PTR key);
		bool WaitStatus(size_t& bytes, ULONG_PTR* key, LPOVERLAPPED* overlapped, size_t timeout);
		void PostStatus(size_t bytes, ULONG_PTR key, LPOVERLAPPED overlapped);
	};
}

